//
//  QNLocalNotification.h
//  QNReuseTool
//
//  Created by rsh on 2019/10/15.
//  Copyright © 2019年 rsh. All rights reserved.
//

/**
 *通知管理类
 **/

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#ifdef NSFoundationVersionNumber_iOS_9_x_Max
#import <UserNotifications/UserNotifications.h>
#endif

typedef NS_ENUM(NSInteger, QNLocalNotificationRepeat) {
    QNLocalNotificationRepeatNone,
    QNLocalNotificationRepeatEveryDay,
    QNLocalNotificationRepeatEveryWeek,
    QNLocalNotificationRepeatEveryMonth,
    QNLocalNotificationRepeatEveryYear,
    QNLocalNotificationRepeatEveryWorkDay
};

typedef NSString * QNLocalNotificationKey;
typedef NSString * QNLocalNotificationSoundName;

extern QNLocalNotificationKey const QNNotificationFireDate;
extern QNLocalNotificationKey const QNNotificationAlertTitle;
extern QNLocalNotificationKey const QNNotificationAlertBody;
extern QNLocalNotificationKey const QNNotificationAlertAction;
extern QNLocalNotificationKey const QNNotificationSoundName;
extern QNLocalNotificationKey const QNNotificationUserInfoName;
extern QNLocalNotificationKey const QNNotificationPriority;
extern QNLocalNotificationKey const QNNotificationRepeat;
extern QNLocalNotificationSoundName const QNNotificationSoundAlarm;
extern QNLocalNotificationSoundName const QNNotificationSoundOther;

@interface QNLocalNotification : NSObject

/**
 创建本地通知

 @param attribute 通知的属性
 */
+ (void)createLocalNotificationWithAttribute:(NSDictionary *)attribute;

/**
 取消通知

 @param notificationName 通知名字
 */
+ (void)cancelLocalNotificationWithName:(NSString *)notificationName;

#ifdef NSFoundationVersionNumber_iOS_9_x_Max

/**
 注册通知
 */
+ (void)requestUNUserNotificationAuthorization;

#endif

@end

